import unittest


class Demo1TestCase(unittest.TestCase):
    def test1(self):
        print('test1')

    def test2(self):
        print('test2')


class Demo2TestCase(unittest.TestCase):
    def testa(self):
        print('testa')

    def testb(self):
        print('testb')


if __name__ == '__main__':
    # 普通执行方式
    # unittest.main(verbosity=2)

    # TODO suite 测试套件
    # TODO addTest
    # addTest加载测试方法的顺序,就是执行的顺序
    suite = unittest.TestSuite()
    suite.addTest(Demo1TestCase('test2'))
    suite.addTest(Demo2TestCase('testb'))
    suite.addTest(Demo1TestCase('test1'))

    # runner 执行器
    # 创建执行器对象
    runner = unittest.TextTestRunner(verbosity=2)
    runner.run(suite)

